package net.youyi.crazycopyer.ui;

import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.AppBarLayout;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import net.youyi.crazycopyer.R;
import net.youyi.crazycopyer.adapters.BaseRecyclerAdapter;
import net.youyi.crazycopyer.adapters.CopyAdapter;

/**
 * Created by xzp on 15/11/6.
 */
public class MainActivity extends BaseActivity implements BaseRecyclerAdapter.OnItemClickListener{
    private RecyclerView mCopyRecycler;
    private CopyAdapter mAdapter;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mCopyRecycler= (RecyclerView) this.findViewById(R.id.copy_list);
        mCopyRecycler.setLayoutManager(new LinearLayoutManager(this));
        mAdapter=new CopyAdapter(this);
        mCopyRecycler.setAdapter(mAdapter);
        mAdapter.setOnItemClickListener(this);
    //    AppBarLayout.ScrollingViewBehavior
    }

    @Override
    public void onItemClick(BaseRecyclerAdapter adapter, View item, int position) {
        switch (position){
            case 0:
                startActivity(new Intent(this,BiliDetailActivity.class));
                break;
            case 1:
                startActivity(new Intent(this,EditTextActivity.class));
                break;
            case 2:
                startActivity(new Intent(this,FastBlurActivity.class));
                break;
        }
    }
}
